Java SDK - Java Software Development Kit

It is expected that the information presented here will enable the reader to gain an understanding of the components and structure of the Java Software Development Kit. Further documentation provided by Sun and other Java resources must be referred to in order to learn why, when and how to use the various components of the Java SDK. Many of these topics will be discuss in subsequent lessons. Information related to embedded Java and Java hand-held device programming is not covered.

Java SDK Editions

The Java Software Development Kit comes in two editions, Standard and Enterprise. The following link references a wealth of information about the Java products. http://java.sun.com/products/

Standard Edition

This is the minimum edition of the Java SDK that is needed to create Java programs. It contains the Java Runtime Environment, Tools and Runtime Core API classes as well as the Standard Core API of JavaBeans, Java DataBase Connectivity API (JDBC), Java Foundation Class (JFC), Java Interface Definition Language (IDL), Java Naming and Directory Interface (JNDI) and other classes.

Enterprise Edition

The Enterprise Edition contains all the components of the Standard Edition plus the Enterprise Core API of Enterprise JavaBeans (EJB), JavaServer Pages (JSP), JavaServlets, Java Message Service (JMS), Java Transaction (JTA), Java Transaction Service (JTS), JavaMail, and RMI-IIOP.

Runtime Environment

This is the necessary set of files that are needed to run Java programs. It must be installed on a computer for that computer to be able to run Java programs. This is typically installed in the Program Files\JavaSoft\Jre folder on the computer’s hard disk. There is a distinction made between the Java Runtime Environment to run applications and the JRE within the Java SDK. The distributed Java Runtime Environment also includes a Java Plug-in. This allows a Web browser to use the Java 2 runtime environment instead of the browsers default Java environment. This distributed Java Runtime Environment and Java Plug-in are included in the Java SDK installation kit for convenience.

This following set of files, comprising the Java Runtime Environment (JRE), will automatically be installed with the Java SDK in the JDKRoot directory. The JDKRoot directory is the drive letter:\directory specified to install the Java SDK.

Java SDK JRE Directory Structure and File explanation

<JDKRoot>\jre\bin\ contains the executable files and DLLs for tools and libraries used by the Java platform. Of particular note is the Symcjit.dll file. This file is the Symantec Just In Time compiler. It converts Java byte codes to machine code at runtime when Java classes are loaded by the Java launcher (java). Many of the other files are explained in other section of this page.

<JDKRoot>\jre\bin\classic\jvm.dll is the Windows DLL files used by the classic VM.

<JDKRoot>\jre\bin\hotspot\jvm.dll is the Windows DLL files used by the hotspot VM. HotSpot is a runtime code optimizer. As an application is run over time, analysis is done to determine which pieces of code are run most frequently. As these section are discovered then the JRE translates the Java bytecodes into native machine language to gain added code execution speeds.

<JDKRoot>\jre\lib\ contains the code libraries, property settings, and resource files used by the JRE.

<JDKRoot>\jre\lib\rt.jar is the bootstrap classes (the RunTime classes that comprise the Java platform's core API).

<JDKRoot>\jre\lib\i18n.jar is the character-conversion classes and other files associated with internationalization and localization.

<JDKRoot>\jre\lib\ext\ is the default directory for Java extensions

<JDKRoot>\jre\lib\security\ contains the Java security management files. Of particular note are the java.policy and java.security files.

The java.policy file specifies the Java security policy for this machines Java SDK runtime environment.

The java.security file specifies the Java security properties for this machines Java SDK runtime environment.

Tools

The Java SDK contains several tools to aid in the development of Java applications. These tools are divided into several different categories as listed below. Further documentation about the tools can be viewed in the following file after the Java SDK has been installed on your machine. <JDKRoot>\docs\tooldocs\tools.html

Basic Tools

These tools are part of the general functions related to Java development.

javac – this is the java compiler, it is used to compile Java programs.

java – this is the java launcher, it is used to run Java programs.

javaw – this is a java launcher that runs Java programs without a command console window appearing.

javadoc – this is the API documentation generator, it is used to generate documentation about a Java program that follows a particular format.
See http://java.sun.com/products/jdk/javadoc/writingdoccomments.html

appletviewer – this runs and debugs Java applets without a Web browser.

jar – this tool is used to manage JAR files.
JAR (Java Archive) is a platform-independent file format that aggregates many files into one. Multiple Java applets and their requisite components (.class files, images and sounds) can be bundled in a JAR file and subsequently downloaded to a browser in a single HTTP transaction, greatly improving the download speed. The JAR format also supports compression, which reduces the file size, further improving the download time. In addition, the applet author can digitally sign individual entries in a JAR file to authenticate their origin.

jdb – this is the java debugger, it is used to aid in source level debugging of Java programs.

javah – this tool is used to generate C headers and stubs from a Java program that are needed to extend a Java program with C.

javap – this is the Java class file disassembler. Depending on options this prints method signatures and variables in the Java class.

extcheck – this utility is used to detect jar conflicts with installed extension jar files.

RMI Tools (Remote Method Invocation)

These tools are related to using RMI which is the Java method of accomplishing Remote Procedure Calls (RPC). RPC is the basis for client/server network computing.

rmic – this tool generates stubs (client-side) and skeletons (server-side) for remote objects, used upon an object that is to expose its public interface over the network.

rmiregistry – this tool launches the remote object registry service which is need to establish a machine to "listen" on the network for RMI requests.

rmid – this is the RMI activation system deamon (background process)

serialver – this tool will return the class SerialVersionUID.

Internationalization Tools

These tools are related to supporting internationalization of Java applications.

native2ascii – this tool will convert text to Unicode Latin-1.


Security Tools

These tools are related to security issues of Java distribution and allowed system calls.

keytool – this tool manages keystores and certificates, used to authenticate Java applications.

jarsigner – this tool will generate and verify JAR signatures.

javakey – this is the old version of keytool and jarsigner

policytool – this is a GUI tool for managing the Java policy files, used to specify allowable system calls on a particular machine in its JRE.

Java IDL Tools

These tools are used when creating apps that use CORBA to access databases.

tnameserv – this tool provides access to the naming service.

idlj – this tool generates .java files that map an OMG IDL interface and enable an application written in the Java programming language to use CORBA functionality. (The idltojava tool must be downloaded from the java.sun.com site. See the Docs on Java IDL for a link.)

Java Plug-In Tools

unregbean - Unregisters a packaged JavaBeans component over ActiveX.

Core API

The Core API is defined by Sun (Java’s creator) to be the classes that must be fully implemented to provide an approved Java Runtime Environment. The public interface (attributes, methods and return values) and the functionality of the Core API is guaranteed to be the same on all approved JRE’s. When an approved JRE is installed on a machine then the Runtime Core API is available to Java applications. Nothing extra has to be installed to get the methods in the Runtime Core API. This means you can use the Runtime Core API in your Java programs without being concerned if these methods will be on any or all computers that run your Java application. The Standard Core API is guaranteed to be fully implemented and available on all approved JRE’s. The Enterprise Core API is guaranteed to be fully implemented and available on all Enterprise Editions of the JRE.

Runtime Core API

Accessibility

Defines a contract between user-interface components and an assistive technology that provides access to those components. See JFC Accessibility below.

Applet

Provides the classes necessary to create an applet and the classes an applet uses to communicate with its applet context. The applet framework involves two entities: the applet and the applet context. An applet is an embeddable window (see the Panel class) with a few extra methods that the applet context can use to initialize, start, and stop the applet. The applet context is an application that is responsible for loading and running applets. For example, the applet context could be a Web browser or an applet development environment.

AWT

Contains all of the classes for creating user interfaces and for painting graphics and images. See JFC AWT below.

Beans

Contains classes related to Java Beans development. See JavaBeans below.

Corba

Provides the mapping of the OMG CORBA APIs to the JavaTM programming language, including the class ORB, which is implemented so that a programmer can use it as a fully-functional Object Request Broker (ORB). An ORB handles (or brokers) method invocations between a client and the method's implementation on a server. Because the client and server may be anywhere on a network, and because the invocation and implementation may be written in different programming languages, an ORB does a great deal of work behind the scenes to accomplish this communication.

IO

Provides for system input and output through data streams, serialization and the file system. I/O in Java 2 SDK is a true abstract representation of file and directory pathnames. Support is given for features such as temporary files, conversion of abstract pathnames to URL's, comparability, and access to additional file attributes.

Object Serialization extends the core Java Input/Output classes with support for objects. Object Serialization supports the encoding of objects, and the objects reachable from them, into a stream of bytes; and it supports the complementary reconstruction of the object graph from the stream. Serialization is used for lightweight persistence and for communication via sockets or Remote Method Invocation (RMI). The default encoding of objects protects private and transient data, and supports the evolution of the classes. A class may implement its own external encoding and is then solely responsible for the external format. Serialization now includes an API that allows the serialized data of an object to be specified independently of the fields of the class and allows those serialized data fields to be written to and read from the stream using the existing protocol to ensure compatibility with the default writing and reading mechanisms.

Lang

Provides classes that are fundamental to the design of the Java programming language. The most important classes are Object, which is the root of the class hierarchy, and Class, instances of which represent classes at run time. Frequently it is necessary to represent a value of primitive type as if it were an object. The wrapper classes Boolean, Character, Integer, Long, Float, and Double serve this purpose. An object of type Double, for example, contains a field whose type is double, representing that value in such a way that a reference to it can be stored in a variable of reference type. These classes also provide a number of methods for converting among primitive values, as well as supporting such standard methods as equals and hashCode. The Void class is a non-instantiable class that holds a reference to a Class object represening the primitive type void. The class Math provides commonly used mathematical functions such as sine, cosine, and square root. The classes String and StringBuffer similarly provide commonly used operations on character strings. Classes ClassLoader, Process, Runtime, SecurityManager, and System provide "system operations" that manage the dynamic loading of classes, creation of external processes, host environment inquiries such as the time of day, and enforcement of security policies. Class Throwable encompasses objects that may be thrown by the throw statement. Subclasses of Throwable represent errors and exceptions.

Reference

A subclass of the Lang class, Reference objects support a limited degree of interaction with the garbage collector. A program may use a reference object to maintain a reference to some other object in such a way that the latter object may still be reclaimed by the collector. A program may also arrange to be notified some time after the collector has determined that the reachability of a given object has changed. Reference objects are therefore useful for building simple caches as well as caches that are flushed when memory runs low, for implementing mappings that do not prevent their keys (or values) from being reclaimed, and for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism.

Reflection

A subclass of the Lang class, Reflection enables Java code to discover information about the fields, methods and constructors of loaded classes, and to use reflected fields, methods, and constructors to operate on their underlying counterparts on objects, within security restrictions. The API accommodates applications that need access to either the public members of a target object (based on its runtime class) or the members declared by a given class.

Math

Provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal). BigInteger is analogous to Java's primitive integer types except that it provides arbitrary precision, hence operations on BigIntegers do not overflow or lose precision. In addition to standard arithmetic operations, BigInteger provides modular arithmetic, GCD calculation, primality testing, prime generation, bit manipulation, and a few other miscellaneous operations. BigDecimal provides arbitrary-precision signed decimal numbers suitable for currency calculations and the like. BigDecimal gives the user complete control over rounding behavior, allowing the user to choose from a comprehensive set of eight rounding modes.

Naming

Provides the naming service for Java IDL. The package and all its classes and interfaces were generated by running the tool idlj on the file nameservice.idl, which is a module written in OMG IDL.

Net

Provides the classes for implementing networking applications. Using the socket classes, you can communicate with any server on the Internet or implement your own Internet server. A number of classes are provided to make it convenient to use Universal Resource Locators (URLs) to retrieve data on the Internet.

RMI

Provides the RMI package. RMI is Remote Method Invocation. It is a mechanism that enables an object on one Java virtual machine to invoke methods on an object in another Java virtual machine. Any object that can be invoked this way must implement the Remote interface. When such an object is invoked, its arguments are "marshalled" and sent from the local virtual machine to the remote one, where the arguments are "unmarshalled." When the method terminates, the results are marshalled from the remote machine and sent to the caller's virtual machine. If the method invocation results in an exception being thrown, the exception is indicated to caller.

Security

Provides the classes and interfaces for the security framework. This includes classes that implement an easily configurable, fine-grained access control security architecture. This package also supports the generation and storage of cryptographic public key pairs, as well as a number of exportable cryptographic operations including those for message digest and signature generation. Finally, this package provides classes that support signed/guarded objects and secure random number generation. Many of the classes provided in this package (the cryptographic and secure random number generator classes in particular) are provider-based. The class itself defines a programming interface to which applications may write. The implementations themselves may then be written by independent third-party vendors and plugged in seamlessly as needed. Therefore application developers may take advantage of any number of provider-based implementations without having to add or rewrite code.

Sound

The Java 1.2 platform includes a new sound engine and support for audio in applications as well as applets. The following audio file formats are supported: AIFF, AU and WAV. In addition, the following MIDI based song file formats are supported: MIDI TYPE 0, MIDI TYPE 1, and RMF. Java Sound supports 8- and 16-bit audio data, in mono and stereo, with sample rates from 8kHz to 48kHz. It supports linear and u-law encoded data in any of the supported audio file formats. It includes a software MIDI wavetable synthesizer and can mix and render up to 64 total channels of MIDI and digital audio. Rendering quality defaults to 16-bit stereo data at 22kHz. If this quality is not supported by the client system, it automatically degrades to 8-bit or mono output.

SQL (JDBC)

Provides the JDBC package. JDBC is a standard API for executing SQL statements. It contains classes and interfaces for creating SQL statements, and retrieving the results of executing those statements against relational databases. JDBC has a framework whereby different "drivers" can be installed dynamically to access different databases.

Swing

Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms. See JFC Swing below.

Text

Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages. This means your main application or applet can be written to be language-independent, and it can rely upon separate, dynamically-linked localized resources. This allows the flexibility of adding localizations for new localizations at any time. These classes are capable of formatting dates, numbers, and messages, parsing; searching and sorting strings; and iterating over characters, words, sentences, and line breaks. This package contains three main groups of classes and interfaces:

Internationalization is the process of designing an application so that it can be adapted to various languages and regions without engineering changes. Sometimes the term internationalization is abbreviated as i18n, because there are 18 letters between the first "i" and the last "n."

An internationalized program has the following characteristics:

Util

Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).

Standard Core API

JavaBeans

JavaBeans extends Java platform's "write once - run everywhere" capability to reusable component development. In fact, JavaBeans takes interoperability a major step forward -- your code runs on every OS and also within any application environment. A Beans developer secures a future in the emerging network software market without losing customers that use proprietary platforms, because JavaBeans interoperate with ActiveX, OpenDoc, and LiveConnect. Beans developers need to also download the Beans Development Kit.

The beans package contains classes related to Java Beans development. A few of the classes are used by beans while they run in an application. For example, the event classes are used by beans that fire property and vetoable change events. However, most of the classes in this package are meant to be used by a bean editor (that is, a development environment for customizing and putting together beans to create an application). In particular, these classes help the bean editor create a user interface that the user can use to customize the bean. For example, a bean may contain a property of a special type that a bean editor may not know how to handle. By using the PropertyEditor interface, a bean developer can provide an editor for this special type. To minimize the resources used by a bean, the classes used by bean editors are loaded only when the bean is being edited. They are not needed while the bean is running in an application and therefore not loaded.

JDBC

The JDBCTM API provides universal data access from the JavaTM programming language. Using the JDBC 2.0 API, you can access virtually any data source, from relational databases to spreadsheets and flat files. JDBC technology also provides a common base on which tools and alternate interfaces can be built. The JDBC 2.0 API includes two packages: the java.sql package, known as the JDBC 2.0 core API, and the javax.sql package, known as the JDBC Standard Extension. The JavaTM 2 SDK, Standard Edition, includes the JDBC 2.0 core API and the JDBC-ODBC Bridge. The JavaTM 2 SDK, Enterprise Edition, includes the JDBC 2.0 core API and also the JDBC 2.0 Standard Extension.

To use the JDBC API with a particular database management system, you need a JDBC technology-based driver to mediate between JDBC technology and the database. The JDBC web site maintains a list of vendors with drivers currently available or under development.

The JDBC-ODBC Bridge is a JDBC technology-based driver that makes most Open Database Connectivity (ODBC) drivers available to programmers using the JDBC API. This is a much slower method to use than using a native JDBC driver for a data source. It is to be used when there is no native JDBC driver for the particular data source is available.

JFC

The Java Foundation Classes (JFC) is a comprehensive set of graphical user interface components and foundation services designed to simplify deployment of Internet, intranet and desktop applications. It consists of several components listed below.

Swing (The new GUI classes)

Project Swing is the part of the JavaTM Foundation Classes (JFC) software that implements a new set of GUI components with a pluggable look and feel. Project Swing is implemented entirely in the Java programming language, and is based on the JDKTM 1.1 Lightweight UI Framework. The pluggable look and feel lets you design a single set of GUI components that can automatically have the look and feel of any OS platform (Microsoft Windows, SolarisTM, Macintosh). Project Swing components include both 100% Pure JavaTM certified versions of the existing AWT component set (Button, Scrollbar, Label, etc.), plus a rich set of higher-level components (such as tree view, list box, and tabbed panes).

AWT (The older GUI classes)

The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include:

A user interface object such as a button or a scrollbar is called, in AWT terminology, a component. The Component class is the root of all AWT components. Some components fire events when a user interacts with the components. The AWTEvent class and its subclasses are used to represent the events that AWT components can fire. A container is a component that can contain components and other containers. A container can also have a layout manager that controls the visual placement of components in the container. The AWT package contains several layout manager classes and an interface for building your own layout manager.

Accessibility

Through the Java Accessibility API, developers will be able to create Java applications that can interact with assistive technologies such as screen readers, speech recognition systems and Braille terminals. Accessibility enabled Java applications are not dependent on machines that require assistive technology support, rather these applications will run on any Java-enabled machine with or without assistive technologies.

Drag & Drop

Drag and Drop enables data transfer both across Java and native applications, between Java applications, and within a single Java application.

Input Method Framework

The input method framework enables all text editing components to receive Japanese, Chinese, or Korean text input through input methods. An input method lets users enter thousands of different characters using keyboards with far fewer keys. Typically a sequence of several characters needs to be typed and then converted to create one or more characters. Components can actively use the API to support the on-the-spot input style; otherwise the framework provides root-window style input as a fallback.

Java 2D

The Java 2DTM API is a set of classes for advanced 2D graphics and imaging. It encompasses line art, text, and images in a single comprehensive model. The API provides extensive support for image compositing and alpha channel images, a set of classes to provide accurate color space definition and conversion, and a rich set of display-oriented imaging operators. These classes are provided as additions to the java.awt and java.awt.image packages (rather than as a separate package).

Pluggable Look & Feel

This feature gives users the ability to switch the look and feel of an application without restarting it and without the developer having to subclass the entire component set.

Java IDL

See Naming above

Java Naming and Directory Interface (JNDI)

The Java Naming and Directory InterfaceTM (JNDI) is a standard extension to the JavaTM platform, providing Java technology-enabled applications with a unified interface to multiple naming and directory services in the enterprise. As part of the Java Enterprise API set, JNDI enables seamless connectivity to heterogeneous enterprise naming and directory services. Developers can now build powerful and portable directory-enabled applications using this industry standard.

Collections Framework

The collections framework is a unified architecture for representing and manipulating collections, allowing them to be manipulated independently of the details of their representation. It reduces programming effort while increasing performance. It allows for interoperability among unrelated APIs, reduces effort in designing and learning new APIs, and fosters software reuse. The framework is based on six collection interfaces. It includes implementations of these interfaces, and algorithms to manipulate them.

RMI

See RMI above

Security

See Security above. Topics to be covered in a future lesson include such things as X.509 certificates, use of security tools (keytool, jarsigner, policytool), the details of the java.policy and java.security files.

Enterprise Core API

Enterprise JavaBeans (EJB)

The EJBTM server-side component model simplifies development of middleware components that are transactional, scalable, and portable. Enterprise JavaBeans servers reduce the complexity of developing middleware by providing automatic support for middleware services such as transactions, security, database connectivity, and more.

JavaMail

The JavaMailTM API provides a set of abstract classes that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology-based mail and messaging applications.

JavaServer Pages (JSP)

JavaServer PagesTM (JSP) technology allows Web developers and designers to rapidly develop and easily maintain, information-rich, dynamic Web pages that leverage existing business systems. As part of the JavaTM family, the JSP technology enables rapid development of web-based applications that are platform independent. JavaServer Pages technology separates the user interface from content generation enabling designers to change the overall page layout without altering the underlying dynamic content.

JavaServer Pages technology uses XML-like tags and scriptlets written in the Java programming language to encapsulate the logic that generates the content for the page. Additionally, the application logic can reside in server-based resources (such as JavaBeansTM component architecture) that the page accesses with these tags and scriptlets. Any and all formatting (HTML or XML) tags are passed directly back to the response page. By separating the page logic from its design and display and supporting a reusable component-based design, JSP technology makes it faster and easier than ever to build web-based applications.

JavaServer Pages technology is an extension of the JavaTM Servlet API. Servlets are platform-independent, 100% pure Java server-side modules that fit seamlessly into a web server framework and can be used to extend the capabilities of a web server with minimal overhead, maintenance, and support. Unlike other scripting languages, servlets involve no platform-specific consideration or modifications; they are Java application components that are downloaded, on demand, to the part of the system that needs them. Together, JSP technology and servlets provide an attractive alternative to other types of dynamic web scripting/programming that offers platform independence, enhanced performance, separation of logic from display, ease of administration, extensibility into the enterprise and most importantly, ease of use.

JavaServlets

JavaTM Servlets provide web developers with a simple, consistent mechanism for extending the functionality of a web server and for accessing existing business systems. A servlet can almost be thought of as an applet that runs on the server side -- without a face. Java Servlets have made many web applications possible.

Servlets are the Java platform technology of choice for extending and enhancing Web servers. Servlets provide a component-based, platform-independent method for building web-based applications, without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), Servlets are server- and platform-independent. This leaves you free to select a "best of breed" strategy for your servers, platforms, and tools.

Written in Java, Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. Servlets also access library of HTTP-specific calls, and all the benefits of the mature Java language, including portability, performance, reusability, and crash protection.

Java Message Service (JMS)

Enterprise messaging is now recognized as an essential tool for building enterprise applications. By combining Java technology with enterprise messaging, the JMS API provides a new, powerful tool for solving enterprise computing problems.

Enterprise messaging provides a reliable, flexible service for the asynchronous exchange of critical business data and events throughout an enterprise. The JMS API adds to this a common API and provider framework that enables the development of portable, message based applications in the Java programming language.

The JMS API improves programmer productivity by defining a common set of messaging concepts and programming strategies that will be supported by all JMS technology-compliant messaging systems.

Java Transaction (JTA)

JTA specifies standard JavaTM interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.

Java Transaction Service (JTS)

JavaTM Transaction Service (JTS) specifies the implementation of a Transaction Manager which supports the JavaTM Transaction API (JTA) 1.0 Specification at the high-level and implements the Java mapping of the OMG Object Transaction Service (OTS) 1.1 Specification at the low-level. JTS uses the standard CORBA ORB/TS interfaces and Internet Inter-ORB Protocol (IIOP) for transaction context propagation between JTS Transaction Managers.

A JTS Transaction Manager provides transaction services to the parties involved in distributed transactions: the application server, the resource manager, the standalone transactional application, and the Communication Resource Manager (CRM).

RMI-IIOP

Remote Method Invocation (RMI) over Internet Inter-Orb Protocol (IIOP) delivers Common Object Request Broker Architecture (CORBA) compliant distributed computing capabilities to the JavaTM 2 platform

RMI over IIOP combines the best features of RMI with the best features of CORBA. Like RMI, RMI over IIOP speeds distributed application development by allowing developers to work completely in the Java programming language. When using RMI over IIOP to produce Java technology-based distributed applications, there is no separate Interface Definition Language (IDL) or mapping to learn. Like RMI, RMI over IIOP provides flexibility by allowing developers to pass any serializable Java object (Objects By Value) between application components. Like CORBA, RMI over IIOP is based on open standards defined with the participation of hundreds of vendors and users in the Object Management Group. Like CORBA, RMI over IIOP uses IIOP as its communication protocol. IIOP eases legacy application and platform integration by allowing application components written in C++, Smalltalk, and other CORBA supported languages to communicate with components running on the Java platform.

Optional Extensions

Extensions are packages of Java classes (and any associated native code) that application developers can use to extend the functionality of the core platform. The extension mechanism allows the Java virtual machine (VM) to use the extension classes in much the same way as the VM uses the system classes. The extension mechanism also provides a way for needed extensions to be retrieved from specified URLs when they are not already installed in the Java 2 SDK or Runtime Environment. These extensions are not part of the Core API because they would add unnecessary bulk to the JRE that would go unused for the most part. A provider of these optional extensions must fully implement the extensions as documented in the extensions specification. Therefore, once it is ensured that the extension is installed then you are guaranteed that the entire extension specification is implemented and thus available for use by a Java program. They apply to the two different editions of the JRE, Standard and Enterprise.

Standard Extensions

These extension are considered to be part of the Standard Edition of Java.

InfoBus

InfoBus enables dynamic exchange of data between JavaBeansTM component architecture by defining a small number of interfaces between cooperating Beans and specifying the protocol for use of those interfaces. The protocols are based on a notion of an information bus. All components which implement these interfaces can plug into the bus. As a member of the bus any component can exchange data with any other component in a structured way, including arrays, tables, and database rowsets.

JavaBeans Activation Framework (JAF)

With the JavaBeansTM Activation Framework standard extension, developers who use JavaTM technology can take advantage of standard services to determine the type of an arbitrary piece of data, encapsulate access to it, discover the operations available on it, and to instantiate the appropriate bean to perform said operation(s). For example, if a browser obtained a JPEG image, this framework would enable the browser to identify that stream of data as an JPEG image, and from that type, the browser could locate and instantiate an object that could manipulate, or view that image.

JavaHelp

JavaHelpTM software is a full-featured, platform-independent, extensible help system that enables developers and authors to incorporate online help in applets, components, applications, operating systems, and devices. Authors can also use the JavaHelp software to deliver online documentation for the Web and corporate Intranet.

JavaMail

See JavaMail above.

Java 3D

The Java 3DTM 1.2 API is a set of classes for writing three-dimensional graphics applications and 3D applets. It gives developers high level constructs for creating and manipulating 3D geometry and for constructing the structures used in rendering that geometry.

Java Advanced Imaging

Image processing techniques are used for manipulating and displaying images. Examples of image processing techniques range from simple operations such as contrast enhancement, cropping, and scaling to more complex operations such as advanced geometric warping and frequency domain processing. These are used in a variety of applications including:

The Java Advanced Imaging API extends the Java platform for developing image processing applications and applets in Java. It streamlines the process of creating powerful imaging software solutions.

Java Authentication and Authorization Service (JAAS)

The JavaTM Authentication and Authorization Service (JAAS) is a Java package that enables services to authenticate and enforce access controls upon users. It implements a Java version of the standard Pluggable Authentication Module (PAM) framework, and extends the access control architecture of the JavaTM 2 Platform in a compatible fashion to support user-based authorization.

Why Use JAAS?

The latest release of the JavaTM 2 Software Development Kit, v 1.3 provides a means to enforce access controls based on where code came from and who signed it. The need for such access controls derives from the distributed nature of the JavaTM platform, where, for instance, a remote applet may be downloaded over a public network and then run locally.

The Java 2 platform, however, lacks the means to enforce similar access controls based on who runs the code. To provide this type of access control, the JavaTM 2 security architecture requires additional support for authentication (determining who's actually running the code), and extensions to the existing authorization components to enforce new access controls based on who was authenticated. The Java Authentication and Authorization Service (JAAS) framework augments the Java 2 platform with such support.

Java Cryptography (JCE)

The JavaTM Cryptography Extension (JCE) 1.2 provides a framework and implementations for encryption, key generation and key agreement, and Message Authentication Code (MAC) algorithms. Support for encryption includes symmetric, asymmetric, block, and stream ciphers. The software also supports secure streams and sealed objects. JCE 1.2 is designed so that other cryptography libraries can be plugged in as a service provider, and new algorithms can be added seamlessly. JCE 1.2 supplements the Java 2 platform, which already includes interfaces and implementations of message digests and digital signatures.

Java Management (JMX)

JMX is thus the definitive means for Java management: JMX provides the tools for building distributed, Web-based, modular and dynamic solutions for managing devices, applications and service-driven networks.

This was formerly JMAPI and is also based upon Java Dynamic Management Kit (Java DMK).

Java Media Framework

The JavaTM Media Framework (JMF) is an application programming interface (API) for incorporating audio, video and other time-based media into Java applications and applets.

Java Naming and Directory Interface (JNDI)

See JNDI above.

Java Secure Socket Extension (JSSE)

The JavaTM Secure Socket Extension (JSSE) is a Java package that enables secure Internet communications. It implements a Java version of SSL (Secure Sockets Layer) and TLS (Transport Layer Security) protocols and includes functionality for data encryption, server authentication, message integrity, and optional client authentication. Using JSSE, developers can provide for the secure passage of data between a client and a server running any application protocol (such as HTTP, Telnet, NNTP, and FTP) over TCP/IP.

Why use JSSE?

JSSE enables developers to utilize secure, encrypted communication channels in their applications. By abstracting the complex underlying security algorithms and "handshaking" mechanisms, JSSE minimizes the risk of creating subtle but dangerous security vulnerabilities. Furthermore, it simplifies application development by serving as a building block which developers can integrate directly into their applications.

Java Serial Port (COMM)

The JavaTM Communications API can be used to write platform-independent communications applications for technologies such as voice mail, fax, and smartcards.

This version of the Java Communications API contains support for RS232 serial ports and IEEE 1284 parallel ports. With this functionality, one can:

Java Servlet

See Java Servlets above

RMI-IIOP

See RMI-IIOP above.

Enterprise Extensions

These extension are considered to be part of the Enterprise Edition of Java. At this time there are no officially approved Enterprise Extensions. (June 2000)

Some Other Java Technologies and APIs

This section mentions some of the numerous Java technologies and APIs that are available for specialized usage. They are not part of the Core or even Extension API’s because they would add unnecessary bulk to the JRE that would go unused for the most part.

JavaBlend

Java Blend 2.0 software is Java "transparent persistence" for your Java programming language applications. It provides facilities to map Relational table to Objects and visa/versa. Whether you are creating a 2-tier application, or an n-tier Application Server for your portal, the Java Blend software will scale to build and deploy applications which access tables with millions of rows, thousands of attributes, hundreds of simultaneous database connections, all without having to worry about SQL in your Java application code. And with the new mapping features in version 2.0, your enterprise Java applications can map most complex relationships while supporting multi-media objects like BLOBs.

JavaCheck

JavaCheckTM, is a developer tool for testing whether applications and applets will be compatible with a particular JavaTM environment and can, thus, run on all devices which implement that Java environment. It analyzes class files to find dependencies not included in a particular Java API specification. This helps developers to write Java applications and applets that can run safely on different Java platform implementations.

JavaSpaces

JavaSpacesTM technology is a simple unified mechanism for dynamic communication, coordination, and sharing of objects between JavaTM technology-based network resources like clients and servers. In a distributed application, JavaSpaces technology acts as a virtual space between providers and requesters of network resources or objects. This allows participants in a distributed solution to exchange tasks, requests and information in the form of Java technology-based objects. JavaSpaces technology provides developers with the ability to create and store objects with persistence, which allows for process integrity.

Java Message Queue

Java Message Queue software implements the industry standard Java Message Service (JMS) 1.0.1 specification, which provides a standardized API and common messaging strategies for developers. Java Message Queue software supports traditional, address-based queues for message delivery, but also includes the speed and flexibility of the asynchronous Publish and Subscribe message delivery model. In this model, messages are routed and delivered based on the properties of the message, not on an address or location. Client processes simply register an interest in a particular topic, allowing Java Message Queue software to intelligently and efficiently handle all the communication needs between application components.

Java Shared Data Toolkit

The JavaTM Shared Data Toolkit software is a development library that allows developers to easily add collaboration features to applets and applications written in the Java programming language.

Enterprise developers can use the Java Shared Data Toolkit software to create network-centric applications, such as shared whiteboards or chat environments. It can also be used for remote presentations, shared simulations, and to easily distribute data for enhanced group workflow.

The Java Shared Data Toolkit complements Sun's rich suite of Java multimedia technologies by allowing them to be incorporated into "sessions" created and managed with the Java Shared Data Toolkit.

Java Speech API

The JavaTM Speech API allows developers to incorporate speech technology into user interfaces for their Java programming language applets and applications. This API specifies a cross-platform interface to support command and control recognizers, dictation systems and speech synthesizers.

Java Telephony API (JTAPI)

JTAPI is the JavaTM API for telephony call control. It is an extensible API designed to scale for use in a range of domains from first party call control in a consumer device to third party call control in large distributed call centers.

Java TV API

The digital television revolution is one of the most significant events in the history of broadcast television. Digital television brings far more than significantly improved video and audio quality to the TV experience -- it also ushers in the age of true interactive television. As the market for digital television grows, content developers are looking for a feature-rich, cost-effective, and reliable software platform upon which to build the next generation of interactive television services such as Electronic Programming Guides (EPGs), Video-On-Demand (VOD), and Enhanced Broadcasting.

The JavaTM platform along with the Java TVTM API provides an ideal development and deployment platform for this emerging class of interactive services. The Java programming language provides content developers with a high degree of control and flexibility over the "look and feel" of their applications, enabling them to deliver the most dynamic and compelling interactive television experiences to their audience. In addition, interactive television applications written in the Java programming language offer security, extensibility, and portability across a diverse array of television receivers, saving content developers time and money getting their interactive applications to market.

Jini Connection Technology

Jini™ connection technology (Jini technology) is based on a simple concept. Devices should work together. They should simply connect. No drivers to find, no operating system issues, no weird cables and connectors. Yet Jini technology also introduces some exciting new concepts and capabilities.

Downloading, Installing & Configuring the Java SDK, documentation & source

Installing SDK

Method 1: (From Sun)

Download Java Standard Edition SDK from Sun. See http://java.sun.com/j2se/ and select the appropriate version of Java. If you have previously installed Java then you could follow the link in the <JDKRoot>\readme.html file to the Sun web page that has installation instructions.

Indicate a directory to install the Java SDK in to. When prompted for the components to install, select all of them. The source component is optional but if selected then it will place the src.jar file in the <JDKRoot> directory so that the source code can be installed as documented below.

Method 2: (From GRU Network Install)

Select the Java Standard Edition SDK application from the Network Install tab.

Follow Prompts as such:
Set the PATH environment variable to include <JDKRoot>\bin
Ensure that the CLASSPATH is not set as an environment variable. Use the command line argument –classpath when compiling a Java program instead. The previous method was to set the classpath to where the classes.zip file existed in previous Java SDK installations. The new method is explained below in the classpath section. Also, see the Java SDK Documentation for Tools, Win32, Classpath for more in-depth usage of the classpath.

Enterprise Edition information can be found at http://java.sun.com/j2ee/

Installing Documenation

Download Java Standard Edition Documentation from Sun. See http://java.sun.com/j2se/ and select the appropriate version of the Java documentation.

Unzip the file into <JDKRoot>.
This will create a docs subdirectory and place the documentation files in it.

Depending on the JDKRoot you used you may want to remove the extra directory level between your JDKRoot and the Docs subdirectory.

Installing Source code

Download Java Standard Edition Source from Sun. See http://java.sun.com/j2se/ and select the appropriate version of the Java source. Place the src.jar file in <JDKRoot>.

Use a Command Prompt window.
Change to the JDKRoot directory.
Make sure the MS-DOS Path includes the <JDKRoot>\bin subdirectory.
Enter the command: jar xvf src.jar
This will create a src subdirectory and place the source files in it.

Additional Information about the Java SDK

Directory Structure after Java SDK, Documentation and Source code is installed

JDKRoot = Drive letter:\jdk130 (assuming you install in a directory called jdk130)

<JDKRoot>\bin – Java development tools

<JDKRoot>\demo – Java demos

<JDKRoot>\docs – Java documentation (once documentation installed)

<JDKRoot>\include – C header files, used with native-code programming

<JDKRoot>\include-old – old C header files, only for backwards compatibility, obsolete

<JDKRoot>\jre – Java Runtime Environment, see Java SDK JRE Directory Structure

<JDKRoot>\lib – additional class libraries and support files for the development tools

<JDKRoot>\src – Java 2 Core API source code files (from the src.jar file once installed)

<JDKRoot>COPYRIGHT – copyright notice.

<JDKRoot>License – license agreement.

<JDKRoot>Readme – trimmed version of the readme.html file.

<JDKRoot>readme.html – Starting point for Java SDK information.

<JDKRoot>src.jar – Java 2 Core API source code in a Java archive file.

<JDKRoot>Uninst.isu – Uninstall information

See <JDKRoot>\docs\tooldocs\win32\jdkfiles.html for more directory structure information - which files are required and why.

Classpath and How Classes are found

The class path tells SDK tools and applications where to find third-party and user-defined classes -- that is, classes that are not Java extensions or part of the Java platform. The class path needs to find any classes you've compiled with the javac compiler -- its default is the current directory to conveniently enable those classes to be found.

See <JDKRoot>\docs\tooldocs\win32\classpath.html for more information.

The basic steps of how a class is found is as follows:

First, the Bootstrap classes (rt.jar, i18n.jar – contains Core API (java.lang, java.io, …)) is interrogated to find the class.

Second, the Installed extensions (A installed extension is a JAR files located at jre/lib/ext) is interrogated.

Third, the Downloaded extensions (A download extension is a JAR file that is specified in the Class-Path header field in the manifest of another JAR file) is interrogated.

Finally, the directories listed in the Classpath environment variable is processed left to right to find the specified class.

Non-standard API’s

These API’s are not part of the standard Java platform. They cannot be relied upon to be implemented by other vendors Java Runtime Environment. These classes should not be used at all.

Com.sun.image.codec.jpeg – encode and decode JPEG images

Sun.* packages – unsupported classes.

Docs

In the Java SDK root directory the readme.html file is the starting point for Java SDK information. This file contains information about: System Requirements, Installation, Compatibility with previous Java versions, New Features, Release Notes, Documentation, Demos, Java SDK Contents and other web pages. The docs subdirectory contains html files that document the standard Java system. This can be accessed from the Java 2 SDK Documentation link in the readme.html file or via the index.html file in the docs subdirectory. The following section of the documentation are a good reference point to learn more about the Java SDK.

API & Language

Guide to Features

Tools

Demos, Tutorials & Training

Source code directory structure

<JDKRoot>\src\Com

<JDKRoot>\src\Com\Sun

<JDKRoot>\src\Com\Sun\Image

<JDKRoot>\src\Com\Sun\Image\Codec

<JDKRoot>\src\Com\Sun\Image\Codec\Jpeg – encoding and decoding JPEG images

<JDKRoot>\src\Com\Sun\Java

<JDKRoot>\src\Com\Sun\Java\Swing

<JDKRoot>\src\Com\Sun\Java\Swing\Plaf

<JDKRoot>\src\Com\Sun\Java\Swing\Plaf\Motif – Motif GUI components

<JDKRoot>\src\Com\Sun\Java\Swing\Plaf\Windows – Windows GUI components

<JDKRoot>\src\Com\Sun\Naming\Internal – Resource naming

<JDKRoot>\src\Java – Core API directories

<JDKRoot>\src\Java\Applet – applet classes

<JDKRoot>\src\Java\Awt – abstract windows toolkit classes

<JDKRoot>\src\Java\Beans – component software framework classes

<JDKRoot>\src\Java\Io – input/output classes

<JDKRoot>\src\Java\Lang – java language classes

<JDKRoot>\src\Java\Math – java bigdecimal and biginteger classes

<JDKRoot>\src\Java\Net – java network classes

<JDKRoot>\src\Java\Rmi – java remote method invocation classes

<JDKRoot>\src\Java\Security – java security classes

<JDKRoot>\src\Java\Sql – jdbc classes

<JDKRoot>\src\Java\Text – internationalization and local text formatting classes

<JDKRoot>\src\Java\Util – useful utilities classes

<JDKRoot>\src\Javax – Java extensions

<JDKRoot>\src\Javax\Accessibility – handicap accessibiltiy classes

<JDKRoot>\src\Javax\Naming – resource naming

<JDKRoot>\src\Javax\Swing – GUI classes

<JDKRoot>\src\Launcher – C source code to the java launcher tool

<JDKRoot>\src\Org

<JDKRoot>\src\Org\Omg

<JDKRoot>\src\Org\Omg\Corba… - Corba classes

<JDKRoot>\src\Org\Omg\CosNaming… - IDL Naming classes

<JDKRoot>\src\Org\Omg\SendingContext

<JDKRoot>\src\Org\Omg\stub\…

<JDKRoot>\src\Sun

<JDKRoot>\src\Sun\Tools

<JDKRoot>\src\Sun\Tools\Ttydebug – remote terminal debugger source code

<JDKRoot>\src\Sunw

<JDKRoot>\src\Sunw\Io – serialization interface

<JDKRoot>\src\Sunw\Util – event interface

Development Process

IDE

Simple

Create a directory to store the applications source code. Use your favorite text editor to write programs. In an MS-DOS session use the Java tools to compile and run your programs.

Intermediate

Use the pcGrasp development environment to create projects, edit source code, compile and run Java programs.

Advanced

Use a sophisticated development environment that aids in organizing projects and source code, writing Java syntax, and browsing objects. There are several commercial IDE’s (Sun’s Forte, Symantec Visual Café, Borland Jbuilder, IBM Visual Age, Microsoft VisaulJ++, etc…). There are also freeware and shareware IDE’s available on the Internet. I think that experience is needed in writing Java, Object-oriented application using the simple and intermediate IDE’s before a proper evaluation of what is needed in an advanced IDE can be made. Many of the advanced IDE’s seem quite complicated at first and I think that this is because they are often approached to aid in programming in the imperative/procedural style. The new IDE’s are design to facilitate developing object-oriented applications and therefore you must think in terms of objects to appreciate what the IDE is doing for you. Otherwise it seems as though the IDE is overly complex.

Some features that are useful in selecting an advanced IDE are:

  1. Color syntax
  2. Auto formatting source code to a defined convention
  3. Auto code fill-in (try/catch block, method signatures)

Compile, Run and Debug Cycle

Compile

If you are in the current directory where all the source code for your application is stored then you can simply do:
javac sourcefilename.java

If you are not in the currenty directory or the source code is in more than one directory then use:
javac –classpath <\path>[;<\path>…] <\main path\sourcefilename.java>

You must specify the .java extension.

See <JDKRoot>\docs\tooldocs\win32\javac.html for more information.

Common Errors:

Compiling without specifying the .java extension
javac HelloWorld
javac: invalid argument: HelloWorld

Compiling using the .class extension
javac HelloWorld.class
javac: invalid argument: HelloWorld.class

Run

If you are in the current directory where all the class files for your application is stored then you can simply do:
java classfilename

If you are not in the currenty directory or the class files are in more than one directory then use:
java –classpath <\path>[;<\path>…] <\main path\classfilename>

The .class extension is the default and is not to be specified.

See <JDKRoot>\docs\tooldocs\win32\java.html for more information.

Common Errors:

Trying to run a source file
java HelloWorld.java
Exception in thread "main" java.lang.NoClassDefFounfError: HelloWorld/java

Trying to run a file and specifying the .class extension
java HelloWorld.class
Exception in thread "main" java.lang.NoClassDefFounfError: HelloWorld/class

Not using the same case for the letters in the class name as coded in the source file
The case of the actual text file name doesn’t matter, but it is best if it is the same.
java helloworld
Exception in thread "main" java.lang.NoClassDefFounfError: helloworld (wrong name: HelloWorld)

Debug

See <JDKRoot>\docs\tooldocs\win32\jdb.html for more information.

Debugging session with HelloWorld
javac –g HelloWorld.java
jdb –launch HelloWorld
main[1] step
main[1] list
main[1] step
main[1] locals
main[1] where
main[1] print msg
main[1] threads
main[1] cont

Documenting

javadoc –author –version <java source file>

[Download, Install, Setup the Java 2 SDK v1.3 environment with docs and source code]
[Edit, Compile, Run, Debug and javadoc a simple Hello World program]

Source code:

/*
 * HelloWorld
 *
 * Version Information:
 * Author              Version  Date
 * David Darus         1.0      30 Jun 2000
 *  Original development
 *
 * Copyright Gainesville Regional Utilities (GRU) 2000
 *
 */

import java.io.*;

/**
 * This class is the HelloWorld example.
 * These lines are the class Documentation comment
 *
 * @version 	1.0  30 Jun 2000
 * @author 	David Darus
 */
public class HelloWorld
{
 /*
  * This object provides the service to output the "Hello World"
  * message via the System.out method in java.io
  */

 /**
  * This is the default constructor for the class
  */

 public HelloWorld()
 {
  /*
   * There is nothing to do in this constructor but it is coded so
   * that it is clear what the default constructor (this one) does.
   */
 }

 /**
  * This is the method that runs when this object is invoked with
  * the java command. It is used to test the program.
  */
 public static void main(String args[])
 {
  /*
   * This method outputs "Hello World"
   */

  String msg = "Hello World";

  System.out.println(msg);

 } //end method main

} //end class HelloWorld

Advanced Development

Packaging

Using Java 1.2

Pg. 185-191, Chp 16, 17, 18

Just Java 2

Chp 9

File locations

How to specify the file location of application components.

Versioning

Versioning introduces package level version control where applications and applets can identify at runtime the version of a specific Java Runtime Environment, VM, and class package.

Security

How to ensure that your application is secure.

Licensing

How to ensure proper licensing of products you use and your product when distributed.

Installation kits

How to create an installation kit for your Java application.

 

[Index]